/**
 * Created by xuan on 15/12/2.
 */
define(function (require) {
    require('angular-mocks');
    require('datepicker');
    require('static_public/js/angular_directive/ui_date.js');
    describe('ui_date', function () {
        var scope, $compile, $document, element;
        beforeEach(module('angular.directive.uiDate'));
        beforeEach(inject(function ($rootScope, _$compile_, _$document_) {
            scope = $rootScope;
            $compile = _$compile_;
            $document = _$document_;

        }));

        it('set format minDate maxDate', function () {
            var format = 'yy-MM-dd';
            var minDate = '2015-12-03';
            var maxDate = '2015-12-04';
            element = $compile('<input type="text" format="' + format + '" min-date="' + minDate + '" max-date="' + maxDate + '" ui-date ng-model="date">')(scope);
            element.click();
            scope.$digest();
            expect($dp.dateFmt).toEqual(format);
            expect($dp.minDate).toEqual(minDate);
            expect($dp.maxDate).toEqual(maxDate);
        });
    });
})